<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
	<meta charset="UTF-8">
	<title>医院管理主页面</title>
    <link th:href="@{/css/adminhome.css}" rel="stylesheet">
    <link th:href="@{/css/patientlist.css}" rel="stylesheet">
    <script type="text/javascript" th:src="@{/js/jquery-3.2.1.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/patientlist.js}"></script>
</head>
<body th:style="'background-image: url(/img/bg.jpg)' ">
<!--头部-->
  <div id="head1">
    <h1><b>管理系统</b></h1>
    <a id="exit" th:href="@{logout.do}" onclick="return window.confirm('您确定要退出登陆吗?')">退出登陆</a>
  </div>
  <div id="head2">
    <ul class="">
      <li class="management"><a th:href="@{/viewHospital}"><h2>医院管理</h2></a></li>
      <li class="management"><a th:href="@{/patientlist}"><h2>用户管理</h2></a></li>
      <li class="management"><a th:href="@{/doctorManage/listDoctor}"><h2>医生管理</h2></a></li>
      <li class="management"><a th:href="@{/rolelist}"><h2>角色管理</h2></a></li>
      <li class="management"><a th:href="@{/systemnoticelist(noticeType = 1)}"><h2>系统公告</h2></a></li>
      <li class="management"><a th:href="@{/notice/enterNotice/{pageNum}(pageNum = 1)}"><h2>公告管理</h2></a></li>
    </ul>
  </div>

<!-- 测试 -->
<!--<a th:href="@{/dmy/getDepartmentTwo}">查询科室</a>-->
  <!--身体-->
  <div id="body">
    <h1>医院管理</h1>
    <br><br>
      <a th:href="@{/tohospitaladd}">添加医院信息</a>
    <div id="query">
      <form th:action="@{/viewHospital}">
        请输入医院名称：<input type="text" class="text" th:name="hName" th:value="${hName}">
        <input type="submit" id="submit" th:value="搜索">
        <input type="hidden" id="result" th:value="${session.result}">
      </form>
      <div th:if="${flag == '2' || flag == '0'}" th:align="center">
        <br><br> <h2 th:text="${message}"></h2>
      </div>
      <div th:if="${flag == '1'}">
      <table th:border="1" th:cellspacing="0" th:cellpadding="0" id="patientlist">
        <tr>
          <th>序号</th>
          <th>医院名称</th>
          <th>医院电话</th>
          <th>医院简介</th>
          <th>医院地址</th>
          <th>医院审核状态</th>
          <th>操作</th>
        </tr>

        <tr th:each="hospital:${hospitalList}"
            th:style="'background-color:'+(${hospitalStat.count%2==0?'#F5F5DC':''})">
          <td th:text="${hospitalStat.index + 1}"></td>
          <td th:text="${hospital.hName}"></td>
          <td th:text="${hospital.hTel}"></td>
          <td th:text="${hospital.hDesc}"></td>
          <td th:text="${hospital.hAddress}"></td>
          <td>
              <span th:if="${hospital.hStatus == '1'}">未审核</span>
              <span th:if="${hospital.hStatus == '2'}">审核未通过</span>
              <span th:if="${hospital.hStatus == '3'}">已审核</span>
          </td>
          <td>
              <span th:if="${hospital.hStatus == '1'}">
                 <a th:href="@{/tohospitalaudit(hId = ${hospital.hId})}">审核</a>
                 <a th:href="@{/delHospital(hId=${hospital.hId})}" onclick="return window.confirm('您确定要删除吗?')">删除</a>
              </span>
              <span th:if="${hospital.hStatus == '2'}">
                  <a th:href="@{/tohospitaluqdate(hId = ${hospital.hId})}">修改</a>
                  <a th:href="@{/delHospital(hId=${hospital.hId})}" onclick="return window.confirm('您确定要删除吗?')">删除</a>
              </span>
              <span th:if="${hospital.hStatus == '3'}">
                  <a th:href="@{/delHospital(hId=${hospital.hId})}" onclick="return window.confirm('您确定要删除吗?')">删除</a>
              </span>

          </td>

        </tr>

        <tr id="page">
          <td colspan="8">
            <a th:href="@{/viewHospital(currentPage=1,hName = ${hName})}">首页</a>
            <a th:href="@{/viewHospital(currentPage=${current} - 1,hName = ${hName})}">上一页</a>
            <a th:href="@{/viewHospital(currentPage=${current} + 1,hName = ${hName})}">下一页</a>
            <a th:href="@{/viewHospital(currentPage=${totalPageCount},hName = ${hName})}">尾页</a>
            <span style="margin-left: 10px">
                          第<span th:text="${current}"/> 页/共
                          <span th:text="${totalPageCount}"></span>页
                          (共<span th:text="${totalCount}"></span>条数据)
                      </span>
          </td>
        </tr>
      </table>
      </div>
    </div>
  </div>
  <!--尾部-->
  <div id="footer">
        <ul class="footer">
          <li><a href="http://www.nhc.gov.cn/">国家卫生健康委员会</a><span class="vertical-bar">|</span></li>
          <li><a href="http://www.cma.org.cn/">中华医学会</a><span class="vertical-bar">|</span></li>
          <li><a href="http://wsjkw.henan.gov.cn/">河南省卫生健康委员会</a></li>
        </ul>
  </div>
</body>
</html>